<template>
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="gray" :height="240">
    <van-swipe-item v-for="(image, index) in images" :key="index">
      <img v-lazy="image.image" />
    </van-swipe-item>
  </van-swipe>
</template>

<script>
import { get_swipe_list } from "@/api/wechat";

export default {
  name: "Swipe",
  props: {},
  data() {
    return {
      images: [],
    };
  },
  computed: {},
  methods: {
    getSwipeList() {
      get_swipe_list()
        .then((res) => {
          this.images = res.data;
        })
        .catch((error) => {
          console.log(error);
        });
    },
  },
  created() {
    this.getSwipeList();
  },
};
</script>

<style  scoped>
.my-swipe img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0rem 0rem;
  background-color: #fff;
  pointer-events: none;
}
</style>